<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>电影详情页面</title>
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
    <div class="container">
        <div class="text" style=" text-align:center;"><h1>电影详情页面</h1></div>
        <a>学号：1604220535</a>
        <br>姓名：朱佳靖</br>
        <div class="row">
            <div class="col">
                <label>电影名称：</label>
                <span th:text="${info.name}"></span>
            </div>
            <div class="col">
                <label> 发行日期：</label>
                <span th:text="${info.createDate} ? ${#dates.format(info.createDate,'yyyy-MM-dd')} :''"></span>
            </div>
        </div>
        <div class="row">
            <div class="col"><h4>演员表</h4></div>
            <div class="col"><a class="btn btn-primary" th:href="@{/role/add/{movie_id}(movie_id=${info.id})}">添加新的演员</a></div>

        </div>

         <table class="table table-striped">
            <thead>
            <tr>
                <th>#</th>
                <th>角色</th>
                <th>演员</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="role,roleStat : ${info.roles}">
                <td th:text="${roleStat.index + 1}"></td>
                <td th:text="${role.name}"></td>
                <td th:text="${role.actor.name}"></td>
                <td>
                    <a th:href="@{/role/detail/{actor_id}(actor_id=${role.actor.id})}">详细信息</a>
                    <a th:href="@{/role/edit/{actor_id}(actor_id=${role.id})}">编辑</a>
                    <a th:href="@{/role/delete/{actor_id}(actor_id=${role.actor.id})}">删除</a>
                </td>

            </tr>
            </tbody>

        </table>
    </div>



</body>
</html>